package com.ruoyi.house.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.house.mapper.TbBusinessMapper;
import com.ruoyi.house.domain.TbBusiness;
import com.ruoyi.house.service.ITbBusinessService;

/**
 * 商户Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-05
 */
@Service
public class TbBusinessServiceImpl implements ITbBusinessService 
{
    @Autowired
    private TbBusinessMapper tbBusinessMapper;

    /**
     * 查询商户
     * 
     * @param id 商户主键
     * @return 商户
     */
    @Override
    public TbBusiness selectTbBusinessById(Long id)
    {
        return tbBusinessMapper.selectTbBusinessById(id);
    }

    /**
     * 查询商户列表
     * 
     * @param tbBusiness 商户
     * @return 商户
     */
    @Override
    public List<TbBusiness> selectTbBusinessList(TbBusiness tbBusiness)
    {
        return tbBusinessMapper.selectTbBusinessList(tbBusiness);
    }

    /**
     * 新增商户
     * 
     * @param tbBusiness 商户
     * @return 结果
     */
    @Override
    public int insertTbBusiness(TbBusiness tbBusiness)
    {
        tbBusiness.setCreateTime(DateUtils.getNowDate());
        return tbBusinessMapper.insertTbBusiness(tbBusiness);
    }

    /**
     * 修改商户
     * 
     * @param tbBusiness 商户
     * @return 结果
     */
    @Override
    public int updateTbBusiness(TbBusiness tbBusiness)
    {
        return tbBusinessMapper.updateTbBusiness(tbBusiness);
    }

    /**
     * 批量删除商户
     * 
     * @param ids 需要删除的商户主键
     * @return 结果
     */
    @Override
    public int deleteTbBusinessByIds(Long[] ids)
    {
        return tbBusinessMapper.deleteTbBusinessByIds(ids);
    }

    /**
     * 删除商户信息
     * 
     * @param id 商户主键
     * @return 结果
     */
    @Override
    public int deleteTbBusinessById(Long id)
    {
        return tbBusinessMapper.deleteTbBusinessById(id);
    }
}
